package com.cwx.mychat.entity.constant;

import com.cwx.mychat.entity.enums.UserContactTypeEnum;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class CodeConstant {

    //返回信息
    public static final String RESULT_MSG = "result";

    //定义验证码的key
    public static final String REDIS_KEY_CHECK_CODE = "my-chat:check-code:";
    //心跳
    public static final String REDIS_KEY_WS_USER_HEARTBEAT = "my-chat:ws:user:heartbeat:";
    //token储存
    public static final String REDIS_KEY_WS_TOKEN = "my-chat:ws:token:";
    //机器人UID
    public static final String ROBOT_UID = UserContactTypeEnum.USER.getPrefix() + "robot";
    //系统设置
    public static final String REDIS_KEY_SYS_SETTING = "my-chat:sys:setting";
    //用户联系人列表
    public static final String REDIS_KEY_USER_CONTACT = "my-chat:ws:user:contact:";

    //自定义机器人信息
    public static final String REDIS_ROBOT_INFO = "my-chat:robot:info";

    //1天
    public static final Integer DAY1 = 60 * 60 * 24;
    //验证码的失效时间
    public static final Integer REDIS_TIME = 60;
    //靓号id位数
    public static final Integer INTEGER_11 = 15;
    //token失效时间
    public static final Integer REDIS_KEY_EXPIRES_DAY = DAY1;
    //心跳失效时间
    public static final Integer HEARTBEAT_EXPIRES_SECOND = DAY1;
    //查询之前消息记录时间
    public static final Long MILLIS_SECOND_DAYS_MSG = 3 * DAY1 * 1000L;
    //流结束标志
    public static final String STREAM_END = "!@#$";

    //储存各种代码语言
    public static final Set<String> CODE_LANGUAGE = new HashSet<>(Arrays.asList("c", "c++", "c#", "css", "dart", "go",
            "html", "java", "javascript", "kotlin", "lua", "markdown",
            "objective-c", "php", "python", "ruby", "sql", "typescript", "vue"));
    //前端代码展示的前缀拼接代码
    public static final String CODE_LANGUAGE_PREFIX = "<pre class='pre-code'><div class='text-code-line'><text>%s</text><button class='copy-code-btn'>复制</button></div><code class='code-code-line language-%s line-numbers'>";
    //前端代码展示的后缀拼接代码
    public static final String CODE_LANGUAGE_SUFFIX = "</code></pre>";
}
